<template>
  <component :is="currentCompontens" />
</template>

<script setup>
// 传统方式实现配置面板： 一个组件对应一个配置文件
import { defineProps, onMounted, ref } from "vue";
import { components } from "@/config/index.js";

const props = defineProps({ currentPickType: String });
const currentCompontens = ref();

onMounted(() => {
  const _type = props.currentPickType;

  console.log(16, _type);

  // 渲染右侧面板
  renderPanel(_type);
});

function renderPanel(type) {
  if (!type) return;

  currentCompontens.value = components[type];
}
</script>
